﻿<phone:PhoneApplicationPage  
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    xmlns:tm="clr-namespace:TM.QWeibo.Client.UserControls" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:es="clr-namespace:Microsoft.Expression.Shapes;assembly=Microsoft.Expression.Drawing" 
    x:Class="TM.QWeibo.Client.MainPage"                            
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False" BackKeyPress="PhoneApplicationPage_BackKeyPress">
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Opacity="0.9">
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="设置" x:Name="mSetting" Click="mSetting_Click"/>
                <!--<shell:ApplicationBarMenuItem Text="我的资料" x:Name="mProfile" Click="mProfile_Click"/>-->
                <shell:ApplicationBarMenuItem Text="推荐应用" x:Name="mApps" Click="mApps_Click"/>
                <shell:ApplicationBarMenuItem Text="注销" x:Name="mLogout" Click="mLogout_Click"/>
                <shell:ApplicationBarMenuItem Text="退出" x:Name="mExit" Click="mExit_Click"/>
            </shell:ApplicationBar.MenuItems>
        	<shell:ApplicationBarIconButton x:Name="btnReload" IconUri="/Resource/Icons/refresh.png" Text="刷新" Click="btnReload_Click"/>
			<shell:ApplicationBarIconButton x:Name="btnAdd" IconUri="/Resource/Icons/edit.png" Text="添加" Click="btnAdd_Click"/>
            <shell:ApplicationBarIconButton x:Name="btnProfile" IconUri="/Resource/Icons/profile.png" Text="资料" Click="mProfile_Click"/>
            <!--<shell:ApplicationBarIconButton x:Name="btnList" IconUri="/Resource/Icons/list.png" Text="特别收听"/>-->
            <shell:ApplicationBarIconButton x:Name="btnSearch" IconUri="/Resource/Icons/search.png" Text="搜索" Click="btnSearch_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Style="{StaticResource PageLayoutGrid}">
        <Grid.RowDefinitions>
        	<RowDefinition Height="40"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

		<Grid Height="30" Grid.Row="0" Width="460">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <toolkit:PerformanceProgressBar Grid.Column="0" x:Name="performanceBar" Width="200"  Style="{StaticResource PerformanceProgressBarStyle}" HorizontalAlignment="Left" />
            <StackPanel Grid.Column="1" x:Name="TrayPanel" Orientation="Horizontal" HorizontalAlignment="Right">
                <Image x:Name="imgTweetCount" Style="{StaticResource TrayTweetCountIcon}" Tap="imgTweetCount_Tap"/>
                <TextBlock x:Name="tbTweetCount" Text="2" Style="{StaticResource TrayInfoTextStyle}" Tap="imgTweetCount_Tap"/>
                <Image x:Name="imgCommentCount" Style="{StaticResource TrayCommentCountIcon}" Tap="imgCommentCount_Tap" />
                <TextBlock x:Name="tbCommentCount" Text="2" Style="{StaticResource TrayInfoTextStyle}" Tap="imgCommentCount_Tap"/>
                <Image x:Name="imgMessageCount"  Style="{StaticResource TrayMessageCountcon}" Tap="imgMessageCount_Tap"/>
                <TextBlock x:Name="tbMessageCount" Text="1" Style="{StaticResource TrayInfoTextStyle}" Tap="imgMessageCount_Tap"/>
                <Image x:Name="imgFanxCount" Style="{StaticResource TrayFansCountIcon}" Tap="imgFanxCount_Tap"/>
                <TextBlock x:Name="tbFanxCount" Text="1" Style="{StaticResource TrayInfoTextStyle}" Tap="imgFanxCount_Tap"/>
            </StackPanel>
		</Grid>
		
        <!--TitlePanel contains the name of the application and page title-->
		<StackPanel Grid.Row="1" Orientation="Horizontal">
            <Image x:Name="imgLogo" Style="{StaticResource TweetLogo}" />
            <TextBlock x:Name="tbAccountName" Style="{StaticResource TweetAccountTitle}"/>
		</StackPanel>
        <controls:Pivot x:Name="PivotMain" Style="{StaticResource Pivot}" Grid.Row="2" SelectionChanged="Pivot_SelectionChanged">
    		<!--主页 -->
    		<controls:PivotItem Header="主页">
                <tm:TweetList x:Name="homeTimeLine"  Timeline="Home" ShowType="Full"/>
            </controls:PivotItem>

            <!--提及 -->
    		<controls:PivotItem Header="提及">
                <tm:TweetList x:Name="mentionsTimeLine" Timeline="Mentions" ShowType="Full"/>
            </controls:PivotItem>
            <!--私信-->
    		<controls:PivotItem Header="私信">
                <tm:MessageList x:Name="privateMessage"/>
            </controls:PivotItem>
            <!--广场-->
            <!--<controls:PivotItem Header="广场">
                <ScrollViewer>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="200"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="200"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.Resources>
                            <ControlTemplate x:Key="HubTileButton" TargetType="tm:HubTileButton">
                                <Grid Style="{StaticResource HubTileButton}">
                                    <Image Source="{TemplateBinding Image}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Stretch="UniformToFill"/>
                                    <TextBlock Text="{TemplateBinding Content}" Style="{StaticResource HubTileButtonText}"/>
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>
                        <tm:HubTileButton Grid.Row="0" Grid.Column="0" toolkit:TiltEffect.IsTiltEnabled="True"  Content="热门广播" Image="/Resource/Images/s.broadcast.png" Template="{StaticResource HubTileButton}"/>
                        <tm:HubTileButton Grid.Row="0" Grid.Column="1" toolkit:TiltEffect.IsTiltEnabled="True"  Content="热门话题" Image="/Resource/Images/s.topic.png" Template="{StaticResource HubTileButton}"/>
                        <tm:HubTileButton Grid.Row="1" Grid.Column="0" toolkit:TiltEffect.IsTiltEnabled="True"  Content="推荐名人" Image="/Resource/Images/s.famous.png" Template="{StaticResource HubTileButton}"/>
                        <tm:HubTileButton Grid.Row="1" Grid.Column="1" toolkit:TiltEffect.IsTiltEnabled="True"  Content="可能认识" Image="/Resource/Images/s.mayknow.png" Template="{StaticResource HubTileButton}"/>
                    </Grid>
                </ScrollViewer>
            </controls:PivotItem>-->
        </controls:Pivot>
        <tm:TAd x:Name="homeAd"/>
    </Grid>

</phone:PhoneApplicationPage>